<template>
  <zm-view ref="view">
    <view class="flex flex-col p-24">
      <text class="font-32 mb-24">{{ problem }}</text>
      <zm-richtext :content="answer"></zm-richtext>
    </view>
  </zm-view>
</template>

<script>
import page from "@/mixins/page"
import hook from "@/mixins/hook"
export default {
  mixins: [page, hook],
  data() {
    return {
      answer: "",
      problem: "",
      problemId: ""
    }
  },
  computed: {},
  onLoad(options) {
    console.log(options)
    this.handleInit(options)
    this.handleGetInfo()
  },
  methods: {
    handleInit(options) {
      this.problem = decodeURIComponent(options.problem)
      this.problemId = options.problemId
    },
    async handleGetInfo() {
      // const res = await uni.$api.problem.getProblemInfo({ problemId: this.problemId })
      // v3.1 装修问题详情
      const res = await uni.$api.problem.getProblemFitmentInfo({ questionId: this.problemId })
      this.answer = res.answer
    }
  }
}
</script>

<style lang="scss" scoped></style>
